Ext.ns("addrSearch");

addrSearch.init = function() {
	if( main.isAddrSearch() ) {
		console.log('addrSearch already existed');
	}
	else {
		console.log('none addSearch');
		main.setAddrSearch();
		_first_init();
		_make_panel1();
	//	addrSearch.list_panel.getSearchList();
	}
};

_first_init = function() {
	addrSearch.listStore = new Ext.data.Store({
		model: 'carc_info',
		data: [
		      ],
	});
	
	new Ext.List({
		id:'searchByAddrList',
		title:'주소검색 결과',
		store:addrSearch.listStore,
		onItemDisclosure: {
			handler: function(record, btn, index) {
				console.log("====================");
				console.log(record);
				console.log(btn);
				console.log(index);
				console.log("====================");
				alert('직접 응용해 보세요.');
			}
		},
		itemTpl:'<div><font size="2"><strong>{name}</strong></font></div>',
	});
	
};

_make_panel1 = function() {
	addrSearch.list_panel = new Ext.Panel({
		
		useCurrentLocation: true,
		scroll: 'vertical',
		cardSwitchAnimation: 'slide',
		
		items: [{
			xtype: 'fieldset',
			instructions: 'addrSearchList',
			defaults: { labelAlign: 'left' }
		}],
		getSearchList:function() {
			
			var nStore = new Ext.data.Store({
				model:'carc_info',
				proxy: {
					type: 'ajax',
					url: '/bbb.jsp',
					reader: {
						type : 'xml',
						root: 'lists',
						record: 'carc_info'
					}
				},
				autoLoad: true
			});
			Ext.getCmp('searchByAddrList').bindStore( nStore );
			
		}
	});
	
};